Skip to content

Bugfix WiFiGeneric - SoftAP DHCPServer Corrupt Log Entry #6719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

mrengineer7777
Copy link
Collaborator


Description of Change

Fixes corrupt log entry printed by SoftAP DHCPServer. Converts String() to expected cstr format.

I noticed while testing AP mode that the DHCP Server log prints random trash for the end of the IP address range. This is because a String is passed to a parameter expecting a cstr.

image

The relevant line is WiFiGeneric.cpp:154:
log_v("DHCP Server Range: %s to %s", IPAddress(lease.start_ip.addr).toString(), IPAddress(lease.end_ip.addr).toString());

Should be:
log_v("DHCP Server Range: %s to %s", IPAddress(lease.start_ip.addr).toString().c_str(), IPAddress(lease.end_ip.addr).toString().c_str());

I also searched the entirety of framework-arduinoespressif32 (PIO's copy of arduino-esp32) and verified that toString() is being used properly in all other files.

Tests scenarios

Tested fix on Adafruit Feather ESP32
platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.3/platform-espressif32-2.0.3.zip

Related links

No related issues

Fixes corrupt log entry printed by SoftAP DHCPServer.  Converts String() to expected cstr format.
@me-no-dev me-no-dev merged commit 14156d8 into espressif:master May 11, 2022
@me-no-dev
Copy link
Member

Thanks @mrengineer7777

@mrengineer7777 mrengineer7777 deleted the mrengineer7777-AP-DHCPServer-Log-Fix branch April 28, 2023 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants